Computers were originally developed as a means to accomplish certain tasks. Because of this, the early computer languages were developed on a procedural basis. The very lowest level of computer language is machine code. Machine code is often referred to as a first generation computer language or 1GL, for short. Machine code has the task of manipulating individual quanta of data known as bits to cause the machine hardware to perform a given task. Although machine code is well suited to this function, programming in machine code is both tedious and time-consuming. All other computing languages, starting with assembly languages, are abstractions from this basic level and have the aim of allowing a developer to create applications by means of a more human friendly methodology and/or interface. Assembly languages are generally considered second generation languages or 2GLs.
Development of 3GL and 4GL Languages
As part of this movement away from machine-oriented procedures and towards the world of human interactions and human friendly interfaces, third generation procedural languages (3GLs) such as FORTRAN (FORmula TRANslation), Pascal, and C were developed. More modern languages such as C++ and Java are also considered third generational languages. At the same level, imperative languages were developed as a means of better controlling the state of a computer process, particularly as it applied to databases.
Fourth generation languages (4GLs) are non-procedural. They tend to be imperative because of their early association with database systems. Some examples include Structured Query Language (SQL), Focus, and Adobe PostScript®. Still, 4GL languages represent only an incremental abstraction from 3GLs.
Declarative languages are another attempt at abstraction from a very simplistic procedure-oriented focus on tasks to be accomplished. Declarative languages do not focus on tasks as such, but on relationships between data entities. In this way, declarative languages come closer to the human world in which tasks do occur, but relationships are of primary importance.
In declarative programming, the relationships between elements in a given task dictate how that task may be accomplished. In the declarative model, relationships may be seen as specifiable behavior. In other words, a developer controls the way two data entities relate and interact through the setting of properties. Current declarative languages, however, may only be classified as 3GL and 4GL at best, as they also reveal a machine process orientation.
Internet Reveals Inadequacies of 3GL and 4GL Languages
The advent of the Internet has only served to highlight the deficiencies of traditional 3GL and 4GL languages as application development has struggled to develop tools to meet the demands of e-Business. Applications that are standalone or run only on a given platform are insufficient in this “brave new world” where the concept of “compile once, run anywhere” has become both the mantra and the elusive holy grail of application development.
Current solutions to this seemingly intractable problem are crippled by the historical debt to machine and task-oriented programming. In addition, those applications that do achieve the ability to deploy at more acceptable levels betray their machine and task-oriented origins through their poor quality user interfaces. These interfaces and their task-oriented organization are fundamentally incompatible with user expectations of relationship-based organization.
It has become clear that declarative programming methodologies offer a great advantage in the attempt to meet the need for world-wide deployment, particularly as Web services have become the accepted standard for the creation of flexible Internet applications.
Attempts have been made to overcome the gap between the need for flexible applications and the realities of 3GL and 4GL languages through the addition of declarative programming tools. Unfortunately, the declarative features on 3 and 4 GL languages only solve part of the problem.
For example, in Visual Studio .NET, a Microsoft Corporation product, there are declarative properties that a developer may set on data types such as classes and methods. These declarative properties affect behavior or instruct the compiler to generate slightly different code or more code. In .NET, webMethod is a declarative statement on a method in a class. The webMethod is an instruction to generate a Simple Object Access Protocol (SOAP) interface for the class. This is a declarative way of defining class behavior as the interface surrounds an existing element.
There are two problems with such an approach to declarative programming. First, this approach still requires developers to implement the method in terms of another language such as a 3GL or a 4GL scripting language. Second, this methodology does not fully express the business of the application logic in terms of properties.
A further deficiency of present approaches to declarative programming includes the lack of a visual development environment designed to support declarative programming.